import { Storage } from './index';

export const hasPermission = (permCode) => {
  const permList = Storage.getLoc('permList');

  if (!Array.isArray(permList) || permList.length === 0) return false;

  return permList.filter((perm) => perm.perms === permCode).length > 0;
};
